package ms.maplestory.boot.client.character.Inventory;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.ArrayList;

@Setter
@Getter
@Entity
@Table(name = "equips")
@PrimaryKeyJoinColumn(name = "itemId")
public class Equip extends Item {

    private int reqJob;
    private int reqLevel;
    private int reqSTR;
    private int reqDEX;
    private int reqINT;
    private int reqLUK;
    private int reqPOP;
    private int incSTR;
    private int incDEX;
    private int incINT;
    private int incLUK;
    private int incPDD;
    private int incMDD;
    private int incMHP;
    private int incMMP;
    private int incPAD;
    private int incMAD;
    private int incEVA;
    private int incACC;
    private int incSpeed;
    private int incJump;
    private int tuc;
    private int setItemID;
    private int price;
    private int attackSpeed;
    private boolean expireOnLogout;
    private boolean only;
    private boolean notSale;
    private boolean tradeBlock;
    private String iSlot = "";
    private String vSlot = "";

    @Transient
    private int incMHPr;
    @Transient
    private int incMMPr;
    @Transient
    private short iucMax = 2;
    @Transient
    private boolean hasIucMax = false;

    public Equip() {
        super();
    }

    public Equip deepCopy() {
        Equip ret = new Equip();
        ret.quantity = quantity;
        ret.position = position;
        ret.tuc = tuc;
        ret.iucMax = iucMax;
        ret.hasIucMax = hasIucMax;
        ret.incSTR = incSTR;
        ret.incDEX = incDEX;
        ret.incINT = incINT;
        ret.incLUK = incLUK;
        ret.incMHP = incMHP;
        ret.incMHPr = incMHPr;
        ret.incMMP = incMMP;
        ret.incMMPr = incMMPr;
        ret.incPAD = incPAD;
        ret.incMAD = incMAD;
        ret.incPDD = incPDD;
        ret.incMDD = incMDD;
        ret.incACC = incACC;
        ret.incEVA = incEVA;
        ret.incSpeed = incSpeed;
        ret.incJump = incJump;
        ret.reqSTR = reqSTR;
        ret.reqDEX = reqDEX;
        ret.reqINT = reqINT;
        ret.reqLUK = reqLUK;
        ret.reqLevel = reqLevel;
        ret.reqJob = reqJob;
        ret.reqPOP = reqPOP;
        ret.iSlot = iSlot;
        ret.vSlot = vSlot;
        ret.tradeBlock = tradeBlock;
        ret.only = only;
        ret.notSale = notSale;
        ret.attackSpeed = attackSpeed;
        ret.price = price;
        ret.expireOnLogout = expireOnLogout;
        ret.setItemID = setItemID;
        ret.setOwner(getOwner());
        ret.itemId = itemId;
        ret.dateExpire = dateExpire.deepCopy();
        ret.inventoryType = inventoryType;
        ret.type = type;
        ret.isCash = isCash;
        return ret;
    }

    @Override
    public String toString() {
        return getClass().getName() + "{" +
                "(" + super.toString() +
                ")itemId=" + itemId +
                ", position=" + position +
                ", position=" + position +
                ", quantity=" + quantity +
                ", type=" + type +
                '}';
    }
}
